.MODEL SMALL
.STACK 64

VIDEO_SEG 	SEGMENT AT 0A000H
VID_AREA	DB		1000 DUP (?)
VIDEO_SEG 	ENDS

.286

.DATA
X			DW		?
Y			DW		?
XORIG		DW		?
YORIG		DW		?
LIMITLINE	DW		?
NEGRO		DD		0H
.CODE

MAIN	PROC	NEAR
		MOV		AX, VIDEO_SEG
		MOV 	ES, AX
		ASSUME	ES:VIDEO_SEG
		
		MOV		AH, 0FH			;Petición de modo de video actual
		INT		10H
		
		PUSH 	AX				; Guardar AX
		PUSH	BX				; y BX en el stack
		
		MOV		AX, 0013H		; Modo de video
		INT		10H
		
		CALL	DISPLY
		MOV		AH, 10H			; Función de 
		INT		16H				; Interrupción del teclado
				
		
		MOV		AH, 05H			; Regresar página original
		POP		BX				;
		MOV		AL, BH			; 
		INT		10H
		
		POP		AX				; Regresar modo de video anterior
		MOV		AH, 00H
		INT		10H
		
		MOV		AX, 4C00H		; Fin
		INT		21H
MAIN ENDP		


;----------------------- Pasar a la siguiente línea -----------------------
NEXTLINE	PROC	NEAR
			ADD		X, 320D
			MOV		DI, X
			
			RET
NEXTLINE	ENDP


;----------------------- 		Dibujar Línea 		-----------------------
DRAWLINE	PROC	NEAR

			MOV 	CX, LIMITLINE
			
CIC:		
			MOV		ES:BYTE PTR[DI], AH
			INC		DI
			LOOP 	CIC			

			RET
DRAWLINE	ENDP

;;----------------------- 	Dejar espacios vacíos	-----------------------
EMPTYSPACE	PROC	NEAR
			MOV 	CX, LIMITLINE			
CIC2:		
			INC		DI
			LOOP 	CIC			

			RET
EMPTYSPACE	ENDP

;-----------------------		Pintar en Azul		-----------------------
PAINTBLUE	PROC	NEAR
			MOV		AH, 00110110B
			CALL	DRAWLINE
			RET
PAINTBLUE	ENDP	

;-----------------------		Pintar en Blanco	-----------------------
PAINTWHITE	PROC	NEAR
			MOV		AH, 00001111B
			CALL	DRAWLINE
			RET
PAINTWHITE	ENDP	

;-----------------------		Pintar en Piel		-----------------------
PAINTSKIN	PROC	NEAR
			MOV		AH, 01000000B
			CALL	DRAWLINE
			RET
PAINTSKIN	ENDP	

;-----------------------		Pintar en Negro		-----------------------
PAINTBLACK	PROC	NEAR
			MOV		AH, 0H
			CALL	DRAWLINE
			RET
PAINTBLACK	ENDP	

;-----------------------		Retraso		-----------------------
DELAY	PROC	NEAR
		MOV		AH, 86H
		MOV		CX, 0
		MOV		DX, 60000
		INT		15H	
		MOV		CX, 0FFFFH
DELAYC:			
		LOOP	DELAYC
		RET
DELAY	ENDP

;-----------------------		Limpiar Pantalla	-----------------------
;CLRSCR		PROC	NEAR
;			XOR		AX, AX
;			MOV		BX, XORIG
;			MOV		X, BX
;CLR:			
;			MOV		CX, 24D
;			MOV		DI, X
;CLRSCRC:	MOV		ES:WORD PTR[DI], AX
;			INC		DI
;			LOOP 	CLRSCRC							
;			ADD		X, 320D
;			MOV		DI, X
;			DEC		BL
;			JNZ		CLR							
;			RET				
					
;CLRSCR		ENDP
			
CLRSCR		PROC	NEAR
			XOR		AX, AX
			MOV		CX, 38400D
			MOV		DI, 0
CLRSCRC:	MOV		ES:WORD PTR[DI], AX
			INC		DI
			LOOP 	CLRSCRC									;
			RET						
CLRSCR		ENDP			


;-----------------------	Parado	-----------------------
STANDR		PROC	NEAR

			MOV		AX, XORIG
			MOV		X, AX
			

			;Línea 1
			MOV		LIMITLINE, 04H
			CALL	EMPTYSPACE			
			MOV		LIMITLINE, 07H
			CALL	PAINTBLACK			
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE
			
			;Línea 2
			CALL 	NEXTLINE
			MOV		LIMITLINE, 03H			
			CALL	EMPTYSPACE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE
			
			;LINEA3
			CALL 	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 05H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA4
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE
			MOV		LIMITLINE, 02H
			CALL 	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE		
			
			;LINEA5
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE			
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 03H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE	
					
			
			;LINEA6
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE			
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA7
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE			
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA8
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE			
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA9
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE			
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA10
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE				
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA11
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE
			MOV		LIMITLINE, 2H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA12
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE	
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA13
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE				
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA14
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE				
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA15
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			
			;LINEA16
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 07H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			
			;LINEA17
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 05H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			
			;LINEA18
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 05H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			
			;LINEA19
			CALL	NEXTLINE
			MOV		LIMITLINE, 03H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA20
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE	
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA21
			CALL	NEXTLINE
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE	
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA22
			CALL	NEXTLINE
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE				
			MOV		LIMITLINE, 0AH
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE	
			
			RET
STANDR		ENDP

WALK1R		PROC	NEAR
			
			MOV		AX, XORIG
			MOV		X, AX
			
			;LINEA1		
			MOV		LIMITLINE, 05H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 07H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE					
			
			;LINEA2
			CALL	NEXTLINE
			MOV		LIMITLINE, 04H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA3
			CALL	NEXTLINE
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 05H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA4
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA5
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 03H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA6
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA7
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE		
			
			;LINEA8
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA9
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA10
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA11
			CALL	NEXTLINE
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA12
			CALL	NEXTLINE
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA13
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA14
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA15
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 04H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA16
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 05H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			
			;LINEA17
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			
			;LINEA18
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 07H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 04H
			CALL	PAINTBLACK
			
			;LINEA19
			CALL	NEXTLINE
			MOV		LIMITLINE, 08H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA20
			CALL	NEXTLINE
			MOV		LIMITLINE, 07H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA21
			CALL	NEXTLINE
			MOV		LIMITLINE, 07H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 06H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE											
			
			RET
			
WALK1R		ENDP	

WALK2R		PROC	NEAR

			MOV		AX, XORIG
			MOV		X, AX
			
			;LINEA1
			MOV		LIMITLINE, 04H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 07H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE					
			
			;LINEA2
			CALL	NEXTLINE
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA3
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 05H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA4
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA5
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 03H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA6
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA7
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA8
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA9
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA10
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA11
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA12
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA13
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA14
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA15
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			
			;LINEA16
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 07H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			
			;LINEA17
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 05H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			
			;LINEA18
			CALL	NEXTLINE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 05H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK

			;LINEA19
			CALL	NEXTLINE
			MOV		LIMITLINE, 03H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE					
			
			;LINEA20
			CALL	NEXTLINE
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 05H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE					
			
			;LINEA21
			CALL	NEXTLINE
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE		
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 05H
			CALL	EMPTYSPACE					
			
			;LINEA22
			CALL	NEXTLINE
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE					
			MOV		LIMITLINE, 06H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 05H
			CALL	EMPTYSPACE					
			
			RET			
WALK2R		ENDP

WALK3R		PROC	NEAR
			
			MOV		AX, XORIG
			MOV		X, AX
			
			;LINEA 1
			MOV		LIMITLINE, 05H
			CALL	EMPTYSPACE	
			MOV		LIMITLINE, 07H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	EMPTYSPACE				
			
			;LINEA 2
			CALL	NEXTLINE
			MOV		LIMITLINE, 04H
			CALL	EMPTYSPACE	
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE				
			
			;LINEA 3
			CALL	NEXTLINE			
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE	
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 05H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE				
			
			;LINEA 4
			CALL	NEXTLINE			
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE	
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE				
			
			;LINEA 5
			CALL	NEXTLINE			
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE				
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 03H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE				

			
			;LINEA 6
			CALL	NEXTLINE			
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE				
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE				
			
			;LINEA 7
			CALL	NEXTLINE			
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE				
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE				

			
			;LINEA 8
			CALL	NEXTLINE			
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE				
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	EMPTYSPACE				

			
			;LINEA 9
			CALL	NEXTLINE			
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE				
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE				

			
			;LINEA 10
			CALL	NEXTLINE			
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE				
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 04H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 03H
			CALL	PAINTBLACK


			;LINEA 11
			CALL	NEXTLINE				
			MOV		LIMITLINE, 05H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
		
			
			;LINEA 12
			CALL	NEXTLINE				
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 05H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK

			
			;LINEA 13
			CALL	NEXTLINE			
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK

			
			;LINEA 14
			CALL	NEXTLINE			
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE	
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 06H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE				

			
			;LINE 15
			CALL	NEXTLINE			
			MOV		LIMITLINE, 03H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 01H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE				

			
			;LINEA 16
			CALL	NEXTLINE			
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 05H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 04H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK

			
			;LINEA 17
			CALL	NEXTLINE			
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 04H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			
			
			;LINEA 18
			CALL	NEXTLINE			
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 03H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
	

			;LINEA 19
			CALL	NEXTLINE			
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTSKIN
			MOV		LIMITLINE, 02H
			CALL	PAINTBLUE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 02H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 01H
			CALL	EMPTYSPACE				

			
			;LINEA 20
			CALL	NEXTLINE			
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 0BH
			CALL	PAINTBLACK
			MOV		LIMITLINE, 02H
			CALL	EMPTYSPACE				

			
			;LINEA 21
			CALL	NEXTLINE			
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 03H
			CALL	PAINTWHITE
			MOV		LIMITLINE, 01H
			CALL	PAINTBLACK
			MOV		LIMITLINE, 0BH
			CALL	EMPTYSPACE				

			
			;LINEA 22
			CALL	NEXTLINE			
			MOV		LIMITLINE, 05H
			CALL 	PAINTBLACK
			MOV		LIMITLINE, 0BH
			CALL	EMPTYSPACE				

			
			RET
WALK3R		ENDP


WALKRA		PROC	NEA

			CALL	CLRSCR								
			CALL 	WALK1R
			CALL	DELAY
			CALL	DELAY
			CALL	DELAY						
			CALL	CLRSCR
			CALL	WALK2R
			CALL	DELAY
			CALL	DELAY			
			CALL	DELAY			
			CALL	CLRSCR
			CALL	WALK3R		
			CALL	DELAY
			CALL	DELAY			
			CALL	DELAY				

			RET
WALKRA		ENDP
			

DISPLY	PROC	NEAR
			PUSHA
			
			MOV		XORIG, 150D				;Posición en X inicial	
PARAR:				
			CALL	CLRSCR
			CALL	STANDR

LEER:
			MOV		AH, 10H
			INT 	16H
			
			
			CMP		AH, 01H
			JE		SALIR
			CMP		AH, 4DH
			JNE		LEER
CAMINAR:
			CALL	WALKRA
			ADD		XORIG, 2H			
			MOV		AH, 10H
			INT 	16H
			CMP		AH, 4DH
			JNE		PARAR
						
			JMP		CAMINAR
			
						
			
SALIR:	
			POPA
			RET
DISPLY	ENDP



			END		MAIN			
			